//
//  MainViewController.swift
//  DouYuTV
//
//  Created by 刘育成 on 2020/7/21.
//  Copyright © 2020 刘育成. All rights reserved.
//

import UIKit

class MainViewController: UITabBarController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        childVC(storyName: "recommend")
        childVC(storyName: "YuLe")
        childVC(storyName: "Focus")
        childVC(storyName: "Yuba")
        childVC(storyName: "Find")
        
    }
    
    private func childVC(storyName:String){
        
//        1. 通过Storyboard获取控制器
        let childVc = UIStoryboard(name: storyName, bundle: nil).instantiateInitialViewController()
//        2.将控制器作为子控件
        addChild(childVc!)
    }
    
    
}
